<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定义</title>
    <style>
        body {
            margin: 0px;
            padding: 0px;
            font-size: 18px;
            font-weight: bold;
        }

        .a1 {
            margin: 10px auto;
            width: 300px;
            height: 300px;
            padding: 10px;
            background-color: #ccc;
            border: 1px solid #000;
            position: relative;
        }

        .a2,
        .a3,
        .a4 {
            width: 100px;
            height: 50px;
            line-height: 50px;
            background: #ff0;
            border: 1px solid #000;
            margin: 10px 0px;
            text-align: center;
        }

        .a2 {
            position: relative;
            left: 150px;
            top: 100px;
            z-index: 2;
        }

        .a3 {
            position: relative;
            left: 130px;
            top: 62px;  
            z-index: 3;

        }

        .a4 {
            /* 绝对定位 */
            position: relative;
            /* 距离左边线 */
            left: 110px;
            /* 距离上边线 */
            top: 25px;
            z-index: 4;

        }
    </style>
</head>

<body>
    <div class="a1">
        <div class="a2">1</div>
        <div class="a3">2</div>
        <div class="a4">3</div>
    </div>
</body>

</html>